package learn.cwebsitelearn.chapter8;

import java.util.TreeSet;

/**
 * @AUTHOR LYF
 * @DATE 2022/3/25
 * @VERSION 1.0
 * @DESC
 */
interface Hello{
    int a = 0;

    void method();
}

public class Demo3 {
    public static void main(String[] args) {

        String str1="hello";
        String str2="hello";
        String str3="he"+"llo";// 字面量创建---常量池
        String str4=new String("hello");// 在堆中创建--

        System.out.println(  (str1==str2)+ ";"+ (str2==str3) +";" +(str3==str4));//true;true;false

        TreeSet<Integer> treeSet = new TreeSet<>();
        treeSet.add(1);
        treeSet.add(3);
        treeSet.add(7);

        System.out.println(treeSet);

        TreeSet<Integer> set = new TreeSet<Integer>();
        TreeSet<Integer> subSet = new TreeSet<Integer>();
        for(int i=606;i<613;i++){
            if(i%2==0){
                set.add(i);
            }
        }
        subSet = (TreeSet)set.subSet(608,false,611,true);
        System.out.println(set+" "+subSet);
        set.add(609);
        System.out.println(set+" "+subSet);

        // 低精度向高精度
        double a = 1;
        //Double b = 1;// 报错
        Double b =(double) 1;// 由低向上转型
       // Double c =(Double) 1;// cant cast 'int' to 'java.lang.Double'

        //
        double c = 1.1;
        int d = (int) c;// 高转低



        try{

        }finally {

        }




    }
}
